package com.example.demovalidator.api;

import com.example.demovalidator.Vo.ResultVo;
import com.example.demovalidator.entity.Student;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;


/**
 * @author lxw
 * @date 2021/8/9
 * @apiNote
 */
@RestController
@RequestMapping("/demo")
@Validated //对本类中的方法进行校验
public class StudentController {

    @PostMapping
    public ResultVo add(@RequestBody @Valid/*校验后面的参数*/ Student student){
        return ResultVo.success();
    }
}
